package com.payroll.taglib.outliner;

import java.io.Serializable;
/**
 * This is the OutlinerForm bean which is used for the following:
 * <li> Get information from the request to pass to the appliction outliner action classes.
 * <li> Application outliner Data Access classes populate this bean and place a vector in the
 * request object for the @see com.ams.sacwis.outliner.AMSOutlinerPage tag to build an outliner
 * from the attributes of each element in the vector.
 * <br/> The various attributes of the bean are:
 * <li> customcontrol - This is an area for the application developer to add HTML controls like
 * radio buttons or checkboxes. An example would when a generated outliner is used to select one
 * or multiple rows generated as a result of a search.
 * <li> iconplus - Icon to be displayed before expansion. This is the name of the icon in the
 * /images folder. blank.bmp will be displayed if no icon is specified.
 * <li> iconminus - Icon to be displayed after the node is expanded. This is the name of the icon in the
 * /images folder. Specify this icon only if the node is expandable. blank.bmp will be displayed if no icon
 * is specified.
 * <li> text - This is the text that needs to be displayed to the user. Add HTML attributes like SPAN with title
 * for fields that need custom titles. For example:<br/>
 * <code> 	AMSOutlinerForm m_form = new AMSOutlinerForm();
 * <br/>	m_form.setText("Jane E. Simmons, &ltSPAN title='Date of birth'&gt 11/29/1975 &ltSPAN&gt");
 * </code>
 * <br/> Notes:
 * 		<ol> If the attribute expandorlink is set to a "link" or "both" the above text is displayed as a link
 * 		<ol> If the attribute specialcase is "true" the above text is displayed in red
 * <li> link - This value specifies the launch url when the user clicks on the text if the attrubite expandorlink is "link"
 * <li> expandorlink - This attribute has multiple values:
 * 		<ol> expand - If the outliner row can be expanded to a next level
 * 		<ol> link - If the row is a link to launch a separate window with url as specified by the link attribute
 * 		<ol> both - If the row is both of the above. In this case the link attribute is used when the user
 * 					clicks on the text and nextUrl is used when the user clicks on the icon
 * 		<ol> none - If this is the final level in the outliner and the text is for information only. This should be used
 * 					when displaying messages to the user like "No rows found"
 * <li> subOutliner - This is a Vector of itself to make it recursive. This way if the application needs to display
 * more than one level expanded, set this with a vector of AMSOutlinerForm object
 * <li> nextUrl - The URL of the next outliner level that needs to be executed to get the data to be displayed.
 * <li> key1 - Additional attributes that the nextUrl will need to process expansion.
 * <li> key2 - Additional attributes that the nextUrl will need to process expansion.
 * <li> key3 - Additional attributes that the nextUrl will need to process expansion.
 * <li> key4 - Additional attributes that the nextUrl will need to process expansion.
 * <li> view - This attribute is used only when the @see com.ams.sacwis.outliner.AMSOutlinerPage tag is configured
 * to display selection filters by means of option"n"id and option"n"text attribute. This is used for filtering the
 * data displayed in the outliner and is needed by the nextUrl to process expansion.
 * <li> specialcase - This is a boolean specifying if the current display row is a specialcase of data. In certain cases
 * the text displayed needs to be red to denote a special case. The color is specified by .outlinertextspecial attribute
 * in sacwis.css.
 * The nextLine color is still the color as specified by .outlinerText in sacwis.css
 *
 */
public class PayrollOutlinerForm extends com.payroll.action.PayrollActionForm implements Serializable {
	private String customcontrol = "";
	private String iconplus = "";
	private String iconminus = "";
	private String text = "";
	private String link = "";
	private String expandorlink = "";
	private String secondarylink = "";
	private String secondarylinktitle="";
	private String nextUrl="";
	private String nextLine="";
	private String key1="";
	private String key2="";
	private String key3="";
	private String key4="";
	private String contextRoot = "";
	private String view="default";
	private boolean specialcase=false;
	private String searchselect="";
	private String retrievalSearch = "";
	private boolean subOutlinerDisplay = false;
	private java.util.ArrayList subOutliner = null;

	private boolean fromWSCall = false;
	private java.math.BigDecimal TABLET_LOCK_ID_TABLET_LOCK = null;
	private java.sql.Timestamp TABLET_LOCK_TS_UP = null;

	private String adjacentText="";
	/**
	 * Gets the expandorlink
	 * @return Returns a String
	 */
	public String getExpandorlink() {
		return expandorlink;
	}
	/**
	 * Sets the expandorlink
	 * @param expandorlink The expandorlink to set
	 */
	public void setExpandorlink(String expandorlink) {
		this.expandorlink = expandorlink;
	}

	/**
	 * Gets the iconminus
	 * @return Returns a String
	 */
	public String getIconminus() {
		return iconminus;
	}
	/**
	 * Sets the iconminus
	 * @param iconminus The iconminus to set
	 */
	public void setIconminus(String iconminus) {
		if (iconminus == null)
			iconminus = "";
		this.iconminus = iconminus;

	}

	/**
	 * Gets the iconplus
	 * @return Returns a String
	 */
	public String getIconplus() {
		return iconplus;
	}
	/**
	 * Sets the iconplus
	 * @param iconplus The iconplus to set
	 */
	public void setIconplus(String iconplus) {
		this.iconplus = iconplus;
	}

	/**
	 * Gets the link
	 * @return Returns a String
	 */
	public String getLink() {
		return link;
	}
	/**
	 * Sets the link
	 * @param link The link to set
	 */
	public void setLink(String link) {
		this.link = link;
	}

	/**
	 * Gets the nextUrl
	 * @return Returns a String
	 */
	public String getNextUrl() {
		return nextUrl;
	}
	/**
	 * Sets the nextUrl
	 * @param nextUrl The nextUrl to set
	 */
	public void setNextUrl(String nextUrl) {
		this.nextUrl = nextUrl;
	}

	/**
	 * Gets the text
	 * @return Returns a String
	 */
	public String getText() {
		return text;
	}
	/**
	 * Sets the text
	 * @param text The text to set
	 */
	public void setText(String text) {
		this.text = text;
	}

	/**
	 * Gets the key1
	 * @return Returns a String
	 */
	public String getKey1() {
		return key1;
	}
	/**
	 * Sets the key1
	 * @param key1 The key1 to set
	 */
	public void setKey1(String key1) {
		this.key1 = key1;
	}

	/**
	 * Gets the key2
	 * @return Returns a String
	 */
	public String getKey2() {
		return key2;
	}
	/**
	 * Sets the key2
	 * @param key2 The key2 to set
	 */
	public void setKey2(String key2) {
		this.key2 = key2;
	}

	/**
	 * Gets the key3
	 * @return Returns a String
	 */
	public String getKey3() {
		return key3;
	}
	/**
	 * Sets the key3
	 * @param key3 The key3 to set
	 */
	public void setKey3(String key3) {
		this.key3 = key3;
	}

	/**
	 * Gets the key4
	 * @return Returns a String
	 */
	public String getKey4() {
		return key4;
	}
	/**
	 * Sets the key4
	 * @param key4 The key4 to set
	 */
	public void setKey4(String key4) {
		this.key4 = key4;
	}

	/**
	 * Gets the nextLine
	 * @return Returns a String
	 */
	public String getNextLine() {
		return nextLine;
	}
	/**
	 * Sets the nextLine
	 * @param nextLine The nextLine to set
	 */
	public void setNextLine(String nextLine) {
		this.nextLine = nextLine;
	}

	/**
	 * Gets the customcontrol
	 * @return Returns a String
	 */
	public String getCustomcontrol() {
		return customcontrol;
	}
	/**
	 * Sets the customcontrol
	 * @param customcontrol The customcontrol to set
	 */
	public void setCustomcontrol(String customcontrol) {
		this.customcontrol = customcontrol;
	}

/**
 * Set the variables to the initial state, the ActionForm reset
 * method is called before the bean is populated with the
 * HTTPServletRequest parameters.  When overriding this method,
 * call super.reset(mapping, request) in code
 * Creation date: (1/15/02 9:00:40 PM)
 * @param mapping org.apache.struts.action.ActionMapping
 * @param request javax.servlet.http.HttpServletRequest
 */
public void reset(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request) {

	super.reset(mapping,request);
	customcontrol = null;
	iconplus = null;
	iconminus = null;
	text = null;
	link = null;
	secondarylink = null;
	secondarylinktitle = null;
	expandorlink = null;
	nextUrl=null;
	nextLine=null;
	key1=null;
	key2=null;
	key3=null;
	key4=null;
	subOutliner=null;
	subOutlinerDisplay = false;
	view="default";
	specialcase=false;
	searchselect=null;
	contextRoot = request.getContextPath() + "/";
	}

	/**
	 * Gets the view
	 * @return Returns a String
	 */
	public String getView() {
		return view;
	}
	/**
	 * Sets the view
	 * @param view The view to set
	 */
	public void setView(String view) {
		this.view = view;
	}

	/**
	 * Gets the specialcase
	 * @return Returns a boolean
	 */
	public boolean getSpecialcase() {
		return specialcase;
	}
	/**
	 * Sets the specialcase
	 * @param specialcase The specialcase to set
	 */
	public void setSpecialcase(boolean specialcase) {
		this.specialcase = specialcase;
	}

	/**
	 * Gets the secondarylink
	 * @return Returns a String
	 */
	public String getSecondarylink() {
		return secondarylink;
	}
	/**
	 * Sets the secondarylink
	 * @param secondarylink The secondarylink to set
	 */
	public void setSecondarylink(String secondarylink) {
		this.secondarylink = secondarylink;
	}

	/**
	 * Gets the secondarylinktitle
	 * @return Returns a String
	 */
	public String getSecondarylinktitle() {
		return secondarylinktitle;
	}
	/**
	 * Sets the secondarylinktitle
	 * @param secondarylinktitle The secondarylinktitle to set
	 */
	public void setSecondarylinktitle(String secondarylinktitle) {
		this.secondarylinktitle = secondarylinktitle;
	}

	/**
	 * Gets the searchselect
	 * @return Returns a String
	 */
	public String getSearchselect() {
		return searchselect;
	}
	/**
	 * Sets the searchselect
	 * @param searchselect The searchselect to set
	 */
	public void setSearchselect(String searchselect) {
		this.searchselect = searchselect;
	}

	/**
	 * Gets the contextRoot
	 * @return Returns a String
	 */
	public String getContextRoot() {
		return contextRoot;
	}
	/**
	 * Sets the contextRoot
	 * @param contextRoot The contextRoot to set
	 */
	public void setContextRoot(String contextRoot) {
		this.contextRoot = contextRoot;
	}

	/**
	 * Gets the retrievalSearch
	 * @return Returns a String
	 */
	public String getRetrievalSearch() {
		return retrievalSearch;
	}
	/**
	 * Sets the retrievalSearch
	 * @param retrievalSearch The retrievalSearch to set
	 */
	public void setRetrievalSearch(String retrievalSearch) {
		this.retrievalSearch = retrievalSearch;
	}

	/**
	 * Gets the subOutliner
	 * @return Returns a java.util.ArrayList
	 */
	public java.util.ArrayList getSubOutliner() {
		return subOutliner;
	}
	/**
	 * Sets the subOutliner
	 * @param subOutliner The subOutliner to set
	 */
	public void setSubOutliner(java.util.ArrayList subOutliner) {
		this.subOutliner = subOutliner;
	}

	/**
	 * Gets the subOutlinerDisplay
	 * @return Returns a boolean
	 */
	public boolean getSubOutlinerDisplay() {
		return subOutlinerDisplay;
	}
	/**
	 * Sets the subOutlinerDisplay
	 * @param subOutlinerDisplay The subOutlinerDisplay to set
	 */
	public void setSubOutlinerDisplay(boolean subOutlinerDisplay) {
		this.subOutlinerDisplay = subOutlinerDisplay;
	}

	public String retrieveXMLFileCatalogInfo(){
		String m_return = "";
		if (!(key1 == null || Long.parseLong(key1) < 0 ))
			m_return = key1 + "_";
		return (m_return)
				+ (key2 != null && key2 != "" ? key2 + "_":"")
				+ (key3 != null && key3 != "" ? key3 + "_":"")
				+ (key4 != null && key4 != "" ? key4 + "_":"");
	}


	/**
	 * Gets the fromWSCall
	 * @return Returns a boolean
	 */
	public boolean getFromWSCall() {
		return fromWSCall;
	}
	/**
	 * Sets the offline
	 * @param offline The offline to set
	 */
	public void setFromWSCall(boolean fromWSCall) {
		this.fromWSCall = fromWSCall;
	}

	/**
	 * Returns the tABLET_LOCK_ID_TABLET_LOCK.
	 * @return java.math.BigDecimal
	 */
	public java.math.BigDecimal getTABLET_LOCK_ID_TABLET_LOCK() {
		return TABLET_LOCK_ID_TABLET_LOCK;
	}

	/**
	 * Sets the tABLET_LOCK_ID_TABLET_LOCK.
	 * @param tABLET_LOCK_ID_TABLET_LOCK The tABLET_LOCK_ID_TABLET_LOCK to set
	 */
	public void setTABLET_LOCK_ID_TABLET_LOCK(
		java.math.BigDecimal tABLET_LOCK_ID_TABLET_LOCK) {
		this.TABLET_LOCK_ID_TABLET_LOCK = tABLET_LOCK_ID_TABLET_LOCK;
	}

	/**
	 * Returns the tABLET_LOCK_TS_UP.
	 * @return java.sql.Timestamp
	 */
	public java.sql.Timestamp getTABLET_LOCK_TS_UP() {
		return TABLET_LOCK_TS_UP;
	}

	/**
	 * Sets the tABLET_LOCK_TS_UP.
	 * @param tABLET_LOCK_TS_UP The tABLET_LOCK_TS_UP to set
	 */
	public void setTABLET_LOCK_TS_UP(java.sql.Timestamp tABLET_LOCK_TS_UP) {
		TABLET_LOCK_TS_UP = tABLET_LOCK_TS_UP;
	}

	/**
	 * @return
	 */
	public String getAdjacentText() {
		return adjacentText;
	}

	/**
	 * @param string
	 */
	public void setAdjacentText(String string) {
		adjacentText = string;
	}

}

